import sys
from PyQt5.QtWidgets import QWidget, QApplication, QLabel
from PyQt5.QtGui import QPixmap

def init_widget(wid: QWidget):
    wid.setWindowTitle("图片展示")

    label = QLabel()

    pixmap = QPixmap("./img/img.png")
    label.setPixmap(pixmap)

    label.setParent(wid)

    wid.resize(pixmap.width(), pixmap.height())


if __name__ == "__main__":
    app = QApplication(sys.argv)

    wid  = QWidget()

    init_widget(wid)

    wid.show()

    sys.exit(app.exec_())

